<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Login_model extends MY_Model{
	public function __construct()
    {
        parent::__construct();
    }
    //根据用户名查询用户详情
    public function pm_user_list_name($name){
    	$this->db->where('name',$name);
    	$query=$this->db->get('pm_user');
    	return $query->row_array();
    }
    //更改登陆记录
    public function pm_user_login_editinfo($id,$usertoken){
    	$data['usertoken']=$usertoken;
    	$data['lastlogintime']=time();
    	$data['lastloginip']=get_client_ip();
    	$this->db->where('id',$id);
    	$this->db->update('pm_user',$data);
    	if($this->db->affected_rows()>0){
    		return true;
    	}else{
    		return false;
    	}
    }
}
?>